<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="h" uri="/syzg-html"%>
<!DOCTYPE html>
<html>
<body>
<div class="modal fade bs-example-modal-lg" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">修改人员信息</h4>
      </div>
　　　　　<div class="modal-body" id="modalCore">
        <form class="form-horizontal" role="form" id="aeForm" name="aeForm">
          <input type="hidden" name="id" value="${person.id }" />
          <fieldset>
            <div class="form-group">
			  <label class="col-sm-2 control-label" for="code">人员编号</label>
		  	  <div class="col-sm-3">
                <input type="text" id="code" name="code" value="${person.code }" class="form-control" placeholder="必填项"/>
              </div>
              <label class="col-sm-2 control-label" for="account">人员账号</label>
              <div class="col-sm-3">
                <input type="text" id="account" name="account" value="${person.account }" class="form-control" placeholder="必填项"/>
		      </div>
            </div>
		    <div class="form-group">
		      <label class="col-sm-2 control-label" for="name">人员姓名</label>
		      <div class="col-sm-3">
			    <input type="text" id="name" name="name" value="${person.name }" class="form-control" placeholder="必填项">
		      </div>
		      <label class="col-sm-2 control-label" for="birthday">人员生日</label>
		      <div class="col-sm-3">
                <input type="text" id="birthday" name="birthday" value='<fmt:formatDate pattern="yyyy-MM-dd HH:mm" value="${person.birthday}"/>' class="form-control" readonly>
			    <script type="text/javascript">
               	  $('#birthday').datetimepicker({
               	      format: 'yyyy-mm-dd hh:ii',
               	  	  todayBtn:  'linked',
               	  	  language:  'zh-CN',
               	  	  startView: 2,
               	  	  minView: 0,
               	  	  autoclose: 1
               	  });
			    </script>
		      </div>
		    </div>
		    <div class="form-group">
		      <label for="sex" class="col-sm-2 control-label">性别</label>
			  <div class="col-sm-3">
			    <select id="sex" name="sex" class="form-control" style="width: 50%">
                  <option value="1" <c:if test="${person.sex==1}">selected</c:if>>男</option>
                  <option value="0" <c:if test="${person.sex==0}">selected</c:if>>女</option>
                </select>
              </div>
              <label for="status" class="col-sm-2 control-label">状态</label>
              <div class="col-sm-3">
                <select id="status" name="status" class="form-control" style="width: 50%">
                  <option value="1" <c:if test="${person.status==1}">selected</c:if>>有效</option>
                  <option value="0" <c:if test="${person.status==0}">selected</c:if>>无效</option>
                </select>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label" for="email">E-mail</label>
              <div class="col-sm-3">
                <input type="email" id="email" name="email" value="${person.email }" class="form-control" />
              </div>
              <label class="col-sm-2 control-label" for="homeTel">家庭电话</label>
              <div class="col-sm-3">
                <input type="text" id="homeTel" name="homeTel" value="${person.homeTel }" class="form-control"/>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label" for="homeAddres">家庭住址</label>
              <div class="col-sm-8">
                <input type="text" id="homeAddres" name="homeAddres" value="${person.homeAddres }" class="form-control" />
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label" for="linkman">联系人</label>
              <div class="col-sm-3">
                <input type="text" id="linkman" name="linkman" value="${person.linkman }" class="form-control" />
              </div>
              <label class="col-sm-2 control-label" for="linkmanTel">联系人电话</label>
              <div class="col-sm-3">
                <input type="text" id="linkmanTel" name="linkmanTel" value="${person.linkmanTel }" class="form-control"/>
              </div>
            </div>
          </fieldset>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary" onclick="submitSave('edit');">保存</button>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
$('#aeForm').bootstrapValidator({
  message: 'This value is not valid',
  feedbackIcons: {
      valid: 'glyphicon glyphicon-ok',
      invalid: 'glyphicon glyphicon-remove',
      validating: 'glyphicon glyphicon-refresh'
  },
  fields: {
      name: {
    	  group: '.col-sm-3',
          message: 'The username is not valid',
          validators: {
              notEmpty: {
                  message: 'The username is required and cannot be empty'
              },
              stringLength: {
                  min: 6,
                  max: 30,
                  message: 'The username must be more than 6 and less than 30 characters long'
              }
          }
      },
      email: {
    	  group: '.col-sm-3',
          validators: {
              emailAddress: {
                  message: 'The input is not a valid email address'
              }
          }
      }
  	}
}).on('success.form.bv', function(e, data) {
	FormFunction.submitSave('edit');
});
</script>
</body>
</html>